/*
 * FirstComeFirstServedScheduler.h
 *
 *  Created on: 29-11-2013
 *      Author: Tomasz Lis
 */

#ifndef FIRSTCOMEFIRSTSERVEDSCHEDULER_H_
#define FIRSTCOMEFIRSTSERVEDSCHEDULER_H_

#include <cscheduler.h>
#include <packet_m.h>
#include <vector>
#include <fstream>
using namespace std;

class FirstComeFirstServedScheduler: public cSimpleModule {
public:
    int numberOfDeletedMinPrior;
    int numberOfDeletedMaxPrior;
    int numberOfDeleted;
    int numberOfForward;


    int queueSize;
    vector<Packet*> queueList;
    cMessage* sendTrigger;

    simtime_t lastArrival;
    simtime_t delay;

    FirstComeFirstServedScheduler();
    virtual ~FirstComeFirstServedScheduler();
    virtual void initialize();
    void handleMessage(cMessage* msg);
    bool receivePacket(Packet* packet);
    int getId(int src);
    bool isWaitingPacket();
    Packet* getPacket();
    virtual void finish();
};

Define_Module(FirstComeFirstServedScheduler);
#endif /* FIRSTCOMEFIRSTSERVEDSCHEDULER_H_ */
